package test;

import test.presenter.DefaultCallback;
import test.presenter.DefaultPresenter;
import test.view.DefaultView;
import ms.aurora.databinding.Route;
import ms.aurora.databinding.Router;

import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.matcher.Matchers;

public class DefaultModule extends AbstractModule {

	@Inject
	private static DefaultPresenter defaultPresenter;

	@Override
	protected void configure() {
		bindInterceptor(Matchers.any(), Matchers.annotatedWith(Route.class),
				new Router());
		bind(DefaultPresenter.MyView.class).to(DefaultView.class);
		bind(DefaultCallback.class).to(DefaultPresenter.class);
		requestStaticInjection(DefaultModule.class);
	}

	public static DefaultPresenter getDefaultPresenter() {
		return defaultPresenter;
	}
}
